# $Id$
# Maintainer: Ronald van Haren <ronald.archlinux.org>
# Contributor: Arjan Timmerman <arjan.archlinux.org>
# Contributor: Tom Newsom <Jeepster.gmx.co.uk>

pkgname=imlib2
pkgver=1.5.1
pkgrel=1
pkgdesc="Library that does image file loading and saving as well as rendering, manipulation, arbitrary polygon support"
url="http://sourceforge.net/projects/enlightenment/"
arch=('x86_64')
license=('BSD')
depends=('libtiff' 'giflib' 'bzip2' 'freetype2' 'libxext' 'libpng' 'libid3tag' 'libjpeg-turbo')
source=(http://downloads.sourceforge.net/enlightenment/$pkgname-$pkgver.tar.bz2)
sha512sums=('f9d971674887d4af067c6921e34b6fe598db0317052bc864b676c526b36373ce021d9d49cad95aa64dbbd8e74f1831ddf3ed105900e3df2b66a6b53f7f27c732')


prepare() {
  cd "${pkgname}-${pkgver}"
  sed -i 's/@my_libs@//' imlib2-config.in
}


build() {
  cd "${pkgname}-${pkgver}"

  [ $CARCH = "i686" ] && EXTRAOPTS="--enable-mmx"
  [ $CARCH = "x86_64" ] && EXTRAOPTS="--enable-amd64"

  ./configure --prefix=/usr \
              --sysconfdir=/etc/imlib2 \
              --x-libraries=/usr/lib $EXTRAOPTS
  make
}


check() {
  cd "${pkgname}-${pkgver}"
  make check
}


package() {
  cd "${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" install

  # Install License
  install -Dm644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/COPYING"
}
